﻿<!DOCTYPE html>
<html manifest="/Manifest/offline.manifest">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                    <li>@Html.ActionLink("Todos", "Index", "Todo")</li>
                </ul>
            </div>
        </div>
    </div>
    <div class="container body-content">
        @RenderBody()
        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
        </footer>
    </div>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("#networkStatus").html(navigator.onLine ? 'Online' : 'Offline');

            function Track(output) {
                $("#displayEvents").append("<li>" + output + "</li>");
            }
            $(function () {
                if (window.applicationCache) {
                    window.applicationCache.onchecking = function (e) {
                        Track("Currently we are checking the cache");
                    }
                    window.applicationCache.oncached = function (e) {
                        Track("The contents are Cached");
                    }
                    window.applicationCache.onnoupdate = function (e) {
                        Track("There are no Updates");
                    }
                    window.applicationCache.ondownloading = function (e) {
                        Track("Downloading the contents for site!!");
                    }
                    window.applicationCache.onerror = function (e) {
                        alert(window.applicationCache.status);
                        Track("Something Went wrong" + e.message);
                    }
                    Track("Just Loaded the Window");
                    window.applicationCache.onupdateready = function (e) {
                        applicationCache.swapCache();
                        Track("Cache Updated Successfully");
                    }
                }
            })

        });

    </script>
</body>
</html>
